<!--
	URL/show/:title/skills
	app/views/skills/show.html.erb 
	The show resume/skills view - shows skills for the resume of a user	
	controller: skills, action: show 
-->

<link rel="stylesheet" type="text/css" href="/stylesheets/resume_common.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/skills/show.css" />

<div class="heading">
	<h3> Skills </h3>
	<div class="links">
		<%= link_to 'Add', '/new/'+@resume.title+'/skills' %>	
		<%= link_to 'Edit', '/edit/'+@resume.title+'/skills' %>
	</div>	
</div>

<% form_tag("", :method => "post") do %> <!-- Has to be a form to enable AJAX requests with authenticity tokens -->
	<% if @skills.length!=0 %>
	<table class="skills_table">
		 <tr class="table_heading_row">
			<th class="skillset_type">
			<th class="skill_name">Skill
			<th class="skill_remarks">Remarks 
		</tr> 	
		<% prev = nil %>
		<% @skills.each do |skill| %>
			<% new_skillset = (!prev or skill.skillset_type!=prev.skillset_type) %> <%# Do not show the skillset type if it is the same as the previous one %>
			<% tr_class = new_skillset ? 'new_skillset' : '' %> 
			<tr class=<%=h tr_class %>>
				<%if new_skillset %>
					<td class="skillset_type"><%=h skill.skillset_type %></td>
				<% else %>
					<td class="skillset_type"></td>
				<% end %>
				<td class="skill_name"><%=h skill.skill_name %></td>
				<td class="skill_remarks"><%=h skill.skill_remarks %></td>
				<td class="deleteColumn"><span id="delete_<%=h skill.id %>" class="deleteButton">Delete</span></td>
			</tr>
		<% prev = skill %>
		<% end #loop %>
	</table>
	<% else %>
		<p>
			No skills data.
			<%= link_to 'Add',  '/new/'+@resume.title+'/skills' %>	
		</p>
	<% end #if %>
<% end # form %>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/resume_common.js"></script>
<script type="text/javascript" src="/javascripts/skills/show.js"></script>
 